package com.hw.paltfrom.controller.banlist;

import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.banlist.BlacklistCarService;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.BlacklistCarDetailsVo;
import com.hw.paltfrom.vo.BlacklistCarVo;

/**
 * 车辆黑名单 邢家华 2019-11-6 16:11:11
 * 
 * @author Administrator
 *
 */
@RestController
@RequestMapping(value = "/hwBlacklistCar")
public class BlacklistCarController {

	@Autowired
	private BlacklistCarService hwBlacklistCarService;

	// 黑名单查询
	@RequestMapping(value = "/query")

	public Map<String, Object> Query(@RequestParam HashMap<String, Object> vo) {

		return hwBlacklistCarService.queryAllList(vo);

	}

	// 黑名单详情查询
	@RequestMapping(value = "/queryDetails")

	public Map<String, Object> QueryDetails(BlacklistCarVo vo) {

		return hwBlacklistCarService.queryDetailsList(vo);

	}

	// 黑名单新增
	@RequestMapping(value = "/insert")
	public Map<String, Object> insert(BlacklistCarVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBlacklistCarService.insert(vo);
	}

	// 黑名单修改
	@RequestMapping(value = "/update")
	public Map<String, Object> update(BlacklistCarVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBlacklistCarService.update(vo);
	}

	// 黑名单详情新增
	@RequestMapping(value = "/insertDetails")
	public Map<String, Object> insertDetails(BlacklistCarDetailsVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBlacklistCarService.insertDetails(vo);
	}

	// 导出excel
	@RequestMapping("exportExcel")
	public ResponseEntity<byte[]> exportExcel(BlacklistCarDetailsVo vo) {

		return hwBlacklistCarService.exportExcel(vo);

	}

}
